package com.liuhouse1.controller;

import com.liuhouse1.config.SchoolInfo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class SchoolController {
    //因为在类那边使用了@Component注解，放入了spring的IOC容器,所以这里可以直接进行注入
    @Resource
    private SchoolInfo schoolInfo;

    @RequestMapping("/doSchool")
    @ResponseBody
    public String doSchool(){
        return "学校信息" + schoolInfo;
    }

}
